//递归
#include<stdio.h>

int fib(int n){
    if(n ==1 || n ==2)
        return 1;
    else
        return fib(n-1)+fib(n-2);
}
int main(){
    long long int n = 0;
    int sum = 0;
    
    scanf("%lld", &n);
    
    sum = fib(n);
    
    printf("%d", sum);
    
    return 0;
}

//非递归
#include<stdio.h>

int main(){
    long long int n = 0, sum = 0, a = 0, b = 1;
   
    scanf("%lld", &n);
    if(n == 0)
        sum = 0;
    else if(n == 1)
        sum = 1;
    else{
        for(int i = 3; i <= n; i++){
            sum = a + b;
            a = b;
            b = sum;
        }
    }
    printf("%lld", sum);
    
    return 0;
}

/*求fib数列的第n项，前几项是1，1，2，3，5,每一项都等于前面两项的和*/